import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.win32.W32APIOptions;

import java.nio.CharBuffer;

public interface MyUser32 extends User32 {
    /**
     * The instance.
     */
    MyUser32 INSTANCE = Native.loadLibrary("user32", MyUser32.class, W32APIOptions.DEFAULT_OPTIONS);

    int SendMessage(HWND hWnd, int Msg, int wParam, String lParam);

    int SendMessage(HWND hWnd, int msg, int wParam, int lParam);

    int SendMessage(HWND hWnd, int msg, int wParam, boolean lParam);

    int SendMessage(HWND hWnd, int msg, int wParam, char[] lParam);

    HANDLE SendMessage(HWND hWnd, int msg, int wParam, HANDLE lParam);

    int SendMessage(HWND hWnd, int msg, HANDLE wParam, boolean lParam);

    int SendMessage(HWND hWnd, int msg, boolean wParam);



    /**
     * Sends the specified message to a window or windows. The SendMessage
     * function calls the window procedure for the specified window and does
     * not return until the window procedure has processed the message.
     *
     * @param hWnd
     *            A handle to the window whose window procedure will receive
     *            the message. If this parameter is HWND_BROADCAST
     *            ((HWND)0xffff), the message is sent to all top-level
     *            windows in the system, including disabled or invisible
     *            unowned windows, overlapped windows, and pop-up windows;
     *            but the message is not sent to child windows.
     *
     *            Message sending is subject to UIPI. The thread of a
     *            process can send messages only to message queues of
     *            threads in processes of lesser or equal integrity level.
     * @param msg
     *            The message to be sent.
     * @param wParam
     *            Additional message-specific information.
     * @param lParam
     *            Additional message-specific information.
     * @return The return value specifies the result of the message
     *         processing; it depends on the message sent.
     * @see <a href=
     *      "http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx"
     *      >SendMessage function (Windows)</a>
     */
    HWND SendMessage(HWND hWnd, int msg, WPARAM wParam, HWND lParam);

    /**
     * Sends the specified message to a window or windows. The SendMessage
     * function calls the window procedure for the specified window and does
     * not return until the window procedure has processed the message.
     *
     * @param hWnd
     *            A handle to the window whose window procedure will receive
     *            the message. If this parameter is HWND_BROADCAST
     *            ((HWND)0xffff), the message is sent to all top-level
     *            windows in the system, including disabled or invisible
     *            unowned windows, overlapped windows, and pop-up windows;
     *            but the message is not sent to child windows.
     *
     *            Message sending is subject to UIPI. The thread of a
     *            process can send messages only to message queues of
     *            threads in processes of lesser or equal integrity level.
     * @param msg
     *            The message to be sent.
     * @param wParam
     *            Additional message-specific information.
     * @param lParam
     *            Additional message-specific information.
     * @return The return value specifies the result of the message
     *         processing; it depends on the message sent.
     * @see <a href=
     *      "http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx"
     *      >SendMessage function (Windows)</a>
     */
    int SendMessage(HWND hWnd, int msg, WPARAM wParam, Structure lParam);

    /**
     * Sends the specified message to a window or windows. The SendMessage
     * function calls the window procedure for the specified window and does
     * not return until the window procedure has processed the message.
     *
     * @param hWnd
     *            A handle to the window whose window procedure will receive
     *            the message. If this parameter is HWND_BROADCAST
     *            ((HWND)0xffff), the message is sent to all top-level
     *            windows in the system, including disabled or invisible
     *            unowned windows, overlapped windows, and pop-up windows;
     *            but the message is not sent to child windows.
     *
     *            Message sending is subject to UIPI. The thread of a
     *            process can send messages only to message queues of
     *            threads in processes of lesser or equal integrity level.
     * @param msg
     *            The message to be sent.
     * @param wParam
     *            Additional message-specific information.
     * @param buffer
     *            Additional message-specific information.
     * @return The return value specifies the result of the message
     *         processing; it depends on the message sent.
     * @see <a href=
     *      "http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx"
     *      >SendMessage function (Windows)</a>
     */
    int SendMessage(HWND hWnd, int msg, WPARAM wParam, CharBuffer buffer);
}
